{extend name="base"}
{block name="content"}
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li ><a href="{:url('Video/index')}">视频管理</a></li>
			{empty name="id"}
			<li class="active"><a href="{:url('Video/add')}">添加视频</a></li>
			{else/}
			<li><a href="{:url('Video/add')}">添加视频</a></li>
			<li class="active"><a href="{:url('Video/edit',['id'=>$id])}">编辑视频</a></li>
			{/empty}	
		</ul>
		<form method="post" class="form-horizontal js-ajax-form" action="">
			{notempty name="id"}
			<input name="id" type="hidden" value="{$id}" />
			{/notempty}
			<fieldset>
				<div class="control-group">
					<label class="control-label">视频标题</label>
					<div class="controls">
						<input type="text" name="title" value="{$list[0]->title|default=''}">
						<span class="form-required">*</span>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">标识</label>
					<div class="controls">
						<input type="text" name="key" value="{$list[0]->key|default=''}">
						<span class="form-required">*</span>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">视频地址</label>
					<div class="controls">
						<input type="text" name="video_url" value="{$list[0]->video_url|default=''}">
						<span class="form-required">*</span>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">缩略图</label>
					<div class="controls">
						<input class="ke-input-text" type="text" id="url" value="{$list[0]->thumb|default=''}" name='thumb' readonly="readonly" /> 
						<input type="button" id="uploadButton" value="上传缩略图" />
						{empty name="list[0]->thumb"}
						<img src="" style="width:50px;height:50px; display:none;" id="show_thumb"/>
						{else/}
						<img src="{$list[0]->thumb}" style="width:50px;height:50px;" id="show_thumb"/>
						{/empty}
						
						<span class="form-required">*</span>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">一句话描述</label>
					<div class="controls">
						<textarea name="desc" rows="5" cols="200">{$list[0]->desc|default=''}</textarea>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">幻灯片内容</label>
					<div class="controls">
						{empty name="list"}
						{:Core::hook('kindeditor',['name'=>'content','toolbars'=>['source', 'undo', 'redo','plainpaste']])}
						{else/}
						{:Core::hook('kindeditor',['name'=>'content','default_str'=>$list[0]->content,'toolbars'=>['source', 'undo', 'redo']])}
						{/empty}
						<span class="form-required">*</span>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label">观看价格</label>
					<div class="controls">
						<input type="text" name="money"  value="{$list[0]->money|default=0}">
						<span class="form-required">*</span>
					</div>
				</div>
			</fieldset>
			<div class="form-actions">
				<button class="btn btn-primary js-ajax-submit" type="submit">确定操作</button>
				<a class="btn" href="javascript:history.back(-1);">返回</a>
			</div>
		</form>
	</div>
	<script src="__THEMES__/js/common.js"></script>
{/block}